package com.deli.mq.service;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Description:
 * @Author: deli xu
 * @CreateDate: 2018/9/28 10:41
 **/
@Service
public class TestService {
    @RabbitListener(queues = "xuxuxudeli")
    public void getReceive(Map<String,Object> map){
        System.out.println("success getMessage");
        System.out.println(map.get("data"));
    }

    @RabbitListener(queues = "xuxuxudeli")
    public void getReceiveBody(Message message) {
        System.out.println("-----------------");
        System.out.println(message.getBody());
        System.out.println(message.getMessageProperties());
        System.out.println("-----------------");
    }
}
